package com.mkeeper;

import org.apache.log4j.Logger;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;

import java.util.concurrent.CountDownLatch;

@SpringBootApplication
@ImportResource("classpath:dubbo.xml")
public class ProviderApplication {

    private static final Logger logger = Logger.getLogger(ProviderApplication.class);


    @Bean
    public CountDownLatch closeLatch(){
        return new CountDownLatch(1);
    }


    public static void main(String[] args) throws InterruptedException {
        ApplicationContext context = SpringApplication.run(ProviderApplication.class, args);

        logger.info("项目启动");

        CountDownLatch closeLatch = context.getBean(CountDownLatch.class);

        closeLatch.await();
    }
}
